export function flexible () {
  const docEl = document.documentElement
  // set 1rem = viewWidth / 10
  function setRemUnit () {
    const width = docEl.clientWidth > 640 ? 640 : docEl.clientWidth
    const rem = width / 10
    docEl.style.fontSize = rem + 'px'
  }

  setRemUnit()
  // reset rem unit on page resize
  window.addEventListener('resize', setRemUnit)
}
